<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>动态绑定</title>
    <style>
        .ys1{
           background-color: pink;
            width: 300px;
            height: 100px;
        }
        .ys2{
            background-color: #c2ff94;
            width: 300px;
            height: 100px;
        }
        .ys3{
            background-color: #fff545;
            width: 300px;
            height: 100px;
        }
    </style>
</head>
<body>
<div id="app">
    <button @click="info='ys1'">点我加样式1</button>
    <button @click="info='ys2'">点我加样式2</button>
    <button @click="info='ys3'">点我加样式3</button>
    <button @click="info=''">点我取消样式</button>

<!--    起的效果为：使得class的值不再局限是一个string字符串，可以去引用一个vue的变量-->
    <div :class="info">
        div1
    </div>

</div>
<script src="./node_modules/vue/dist/vue.js"></script>
<script>
    var app = new Vue({
        el: "#app",

        data:{
           info:""
        }

    });
</script>


</body>
</html>